package com.cndongtai.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.cndongtai.dao.BaseDao;
import com.cndongtai.dao.inter.TorchnInverterCollectRecordMapper;
import com.cndongtai.po.TorchnInverterCollectRecord;

@Repository("torchnInverterCollectRecordDao")
public class TorchnInverterCollectRecordDao extends BaseDao implements TorchnInverterCollectRecordMapper {

	@Override
	public int addTorchnInverterCollectRecord(TorchnInverterCollectRecord record) {
		SqlSession sqlSession = getSqlSession();
		try {
			TorchnInverterCollectRecordMapper operation = sqlSession.getMapper(TorchnInverterCollectRecordMapper.class);
			return operation.addTorchnInverterCollectRecord(record);
		}catch(Exception e) {
			e.printStackTrace();
		}finally {
			sqlSession.close();
		}
		
		return 0;
	}

	@Override
	public List<TorchnInverterCollectRecord> queryInverterCollectRecord(
			String deviceName) {
		SqlSession sqlSession = getSqlSession();
		try {
			TorchnInverterCollectRecordMapper operation = sqlSession.getMapper(TorchnInverterCollectRecordMapper.class);
			return operation.queryInverterCollectRecord(deviceName);
		}catch(Exception e) {
			e.printStackTrace();
		}finally {
			sqlSession.close();
		}
		
		return null;
	}

	
}
